//
//  IndexMainCollectionViewCell.m
//  atongmuChildren
//
//  Created by 度周末网络-王腾 on 16/6/2.
//  Copyright © 2016年 dzmmac. All rights reserved.
//

#import "IndexMainCollectionViewCell.h"

@implementation IndexMainCollectionViewCell

-(void)awakeFromNib{
    

    self.topLine = [[UIView alloc ] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width/kIndexItemCount, 0.45)];
    self.topLine.backgroundColor = GLOBLE_SEPETOR_LINE_COLOR;
    [self.contentView addSubview:self.topLine];
    
    
    self.horizontalLine = [[UIView alloc ] initWithFrame:CGRectMake(0, GTFixHeightFloat(kScreenW/kIndexItemCount)-0.5, [UIScreen mainScreen].bounds.size.width/kIndexItemCount, 0.45)];
    self.horizontalLine.backgroundColor = GLOBLE_SEPETOR_LINE_COLOR;
    [self.contentView addSubview:self.horizontalLine];

    
    self.verticalLine = [[UIView alloc ] initWithFrame:CGRectMake(([UIScreen mainScreen].bounds.size.width/kIndexItemCount)-0.5, 0,0.45, GTFixHeightFloat(kScreenW/kIndexItemCount))];
    self.verticalLine.backgroundColor = GLOBLE_SEPETOR_LINE_COLOR;
    [self.contentView addSubview:self.verticalLine];
}

-(void)setIndexPath:(NSIndexPath *)indexPath{
    _indexPath = indexPath;
    if ((indexPath.row+1)%kIndexItemCount == 0) {
        self.verticalLine.hidden = YES;
    }else{
        self.verticalLine.hidden = NO;
    }
    
    
    if (indexPath.row+1 <= kIndexItemCount) {
        self.topLine.hidden = NO;
    }else{
         self.topLine.hidden = YES;
    }
    
    if (self.isShowTopLine == NO) {
        self.topLine.hidden = YES;
    }
}


-(void)showByModel:(moduleListInfoModel *)model{
    [self.img sd_setImageWithURL:[NSURL URLWithString:model.icon]];
}

@end
